//package cn.tth.test.rabbitmq;
//
//import com.fasterxml.jackson.databind.JsonSerializer;
//import com.rabbitmq.client.Channel;
//import org.springframework.amqp.AmqpException;
//import org.springframework.amqp.core.ExchangeTypes;
//import org.springframework.amqp.core.Message;
//import org.springframework.amqp.core.MessagePostProcessor;
//import org.springframework.amqp.rabbit.annotation.*;
//import org.springframework.amqp.rabbit.core.RabbitTemplate;
//import org.springframework.context.ConfigurableApplicationContext;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import javax.annotation.Resource;
//import java.io.IOException;
//import java.util.Arrays;
//
//@RestController
//@RequestMapping("/mq")
//public class MqController {
//
//    @Resource
//    private RabbitTemplate rabbitTemplate;
//    @Resource
//    private MqConfig.RetryMq retryMq;
//
//
//
//    /**
//     * 死信延时队列
//     */
//    @RequestMapping("/t1")
//    public void t1(){
//        System.out.println("t1");
//        rabbitTemplate.convertAndSend(MqConfig.生产者Exchange, MqConfig.生产者RoutingKey, "t1", message -> {
//            message.getMessageProperties().setExpiration("50000");
//            return message;
//        });
//    }
//
//
//    /**
//     * 重试
//     */
//    @RequestMapping("/t2")
//    public void t2(){
//        retryMq.execute(MqConfig.生产者Exchange, MqConfig.生产者RoutingKey,"t2",1000,5000,10000);
//    }
//
//    /**
//     * 基础
//     */
//    @RequestMapping("/t3")
//    public void t3(){
//        rabbitTemplate.convertAndSend(MqConfig.生产者Exchange, MqConfig.生产者RoutingKey_1,"t3");
//    }
//
//}
